import requests
import re

url='http://news.baidu.com/'
headers = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36'
        }
data=requests.get(url,headers=headers).content.decode()
pattern=re.compile('<a href="(.*?)" mon=".*?" target="_blank">(.*?)</a>',re.S)
#<a href="http://www.qstheory.cn/wp/2020-05/12/c_1125973114.htm" target="_blank" mon="r=1">【中国稳健前行】党的领导制度优势的生动体现 </a>

results=pattern.findall(data)
# for result in requests:
print(results,type(results))
# print(re.findall('<li .*>.*<a href="(.*?)" mon=".*?" target="_blank">(.*?)</a>.*?</li>',data,re.S))
for result in results:
    print(result)
# with open('new.html','w',encoding='utf-8') as f:
#     f.write(data)
